<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function old() {
            console.log(arguments) //arguments类型是对象
        }
        old('a', 'b', 'c')

        //rest参数，可以传任意数量参数
        function date(...args) {
            console.log(args) //args的类型是数组
        }

        date('a', 'b', 'c')

        //rest参数必须放到最后
        function fn(a, b, ...args) {
            console.log(a, b, args)
        }
        fn(1, 2, 3, 4, 5)
    </script>
</body>
</html>